package com.jimmy.gank;

import android.app.Application;

import com.jimmy.gank.di.component.ApplicationComponent;
import com.jimmy.gank.di.component.DaggerApplicationComponent;
import com.jimmy.gank.di.modules.ApplicationModule;
import com.squareup.leakcanary.LeakCanary;

public class GankApplication extends Application {

    private ApplicationComponent mComponent;


    @Override
    public void onCreate() {
        super.onCreate();
        mComponent = DaggerApplicationComponent.builder()
                .applicationModule(new ApplicationModule(this))
                .build();
        mComponent.inject(this);

        if (BuildConfig.DEBUG)
            LeakCanary.install(this);

    }

    public ApplicationComponent getComponent() {
        return mComponent;
    }

}
